//
//  JKRFeedTopLayout.m
//  JKRFeedDemo
//
//  Created by Lucky on 2017/12/10.
//  Copyright © 2017年 Lucky. All rights reserved.
//

#import "JKRFeedTopLayout.h"

@implementation JKRFeedTopLayout

- (instancetype)initWithModel:(JKRFeedDataModel *)model {
    self = [super init];
    
    if (model.order.order_type == 1) { // 陪玩
        switch (model.order.order_status) {
            case 1: // 已发布
            {
                if ([model.feed.author.uid isEqualToString:CurrentUserID]) { // 发布者
                    self.show = NO;
                } else { // 游客
                    self.show = NO;
                }
            }
                break;
            case 4: // 超时无人购买
            {
                if ([model.feed.author.uid isEqualToString:CurrentUserID]) { // 发布者
                    self.show = NO;
                } else { // 游客
                    self.show = NO;
                }
            }
                break;
            case 6: // 老板买单
            {
                if ([model.feed.author.uid isEqualToString:CurrentUserID]) { // 发布者
                    self.show = YES;
                    {
                        NSString *top = @"我的老板";
                        NSMutableAttributedString *topString = [[NSMutableAttributedString alloc] initWithString:top];
                        topString.font = [UIFont systemFontOfSize:12];
                        topString.color = UIColorHex(A7ABB4);
                        YYTextContainer *textContiner = [YYTextContainer containerWithSize:CGSizeMake(MAXFLOAT, MAXFLOAT)];
                        self.topLabelLayout = [YYTextLayout layoutWithContainer:textContiner text:topString];
                        self.topLabelFrame = CGRectMake(15, 0, self.topLabelLayout.textBoundingRect.size.width, 30);
                    }
                    {
                        self.topLineViewFrame = CGRectMake(16, 30, kScreenWidth - 16, 0.5);
                    }
                    {
                        self.headerImageViewFrame = CGRectMake(15, 41, 30, 30);
                        self.headerImageViewURL = [NSURL URLWithString:model.order.payer.thumbnail];
                    }
                    
                    {
                        if (model.order.tracking.desc.length) {
                            NSMutableAttributedString *descString = [[NSMutableAttributedString alloc] initWithString:model.order.tracking.desc];
                            descString.font = [UIFont systemFontOfSize:12];
                            descString.color = UIColorHex(FFA718);
                            YYTextContainer *container = [YYTextContainer containerWithSize:CGSizeMake(MAXFLOAT, MAXFLOAT)];
                            self.statusLabelLayout = [YYTextLayout layoutWithContainer:container text:descString];
                            self.statusLabelFrame = CGRectMake(kScreenWidth - 15 - self.statusLabelLayout.textBoundingRect.size.width, 47, self.statusLabelLayout.textBoundingRect.size.width, self.statusLabelLayout.textBoundingRect.size.height);
                        } else {
                            self.statusLabelLayout = nil;
                            self.statusLabelFrame = CGRectZero;
                        }
                    }
                    
                    {
                        NSString *userName = model.order.payer.username;
                        NSString *uid = model.order.payer.uid;
                        NSInteger baojiLevel = -1;
                        NSMutableAttributedString *bottomString = [NSMutableAttributedString new];
                        NSMutableAttributedString *nameString = [[NSMutableAttributedString alloc] initWithString:userName];
                        nameString.color = UIColorHex(A7ABB4);
                        nameString.font = [UIFont systemFontOfSize:12];
                        YYTextHighlight *highLight = [YYTextHighlight new];
                        highLight.userInfo = @{kFeedTopClickUser:uid};
                        [nameString setTextHighlight:highLight range:nameString.string.rangeOfAll];
                        [bottomString appendAttributedString:nameString];
                        
                        if (baojiLevel == 100 || baojiLevel == 101 || baojiLevel == 102) {
                            NSAttributedString *bjString = [self attributedStringWithImageSize:CGSizeMake(31, 15) image:[JKRFeedDetailHelper imageNamed:[NSString stringWithFormat:@"bj_%zd", baojiLevel]]];
                            [bottomString appendAttributedString:bjString];
                        }
                        
                        bottomString.lineBreakMode = NSLineBreakByTruncatingMiddle;
                        YYTextContainer *container = [YYTextContainer containerWithSize:CGSizeMake(kScreenWidth - self.statusLabelFrame.size.width - 15 - 55 - 10, MAXFLOAT)];
                        self.userLabelLayout = [YYTextLayout layoutWithContainer:container text:bottomString];
                        self.userLabelFrame = CGRectMake(55, 47 - ((baojiLevel == 100 || baojiLevel == 101 || baojiLevel == 102) ? 16 : 0), self.userLabelLayout.textBoundingRect.size.width, self.userLabelLayout.textBoundingRect.size.height + 2);
                    }
                    
                    self.finishButtonFrame = CGRectMake(kScreenWidth - 15 - 90, 94, 90, 30);
                    self.chatButtonFrame = CGRectMake(kScreenWidth - 117 - 90, 94, 90, 30);
                    self.startButtonFrame = CGRectZero;
                    self.selectButtonFrame = CGRectZero;
                    self.disabledSelectButtonFrame = CGRectZero;
                    
                    {
                        self.bottomLabelFrame = CGRectZero;
                        self.bottomLabelLayout = nil;
                    }
                } else if([model.order.payer.uid isEqualToString:CurrentUserID]) { // 老板
                    self.show = NO;
                } else { // 游客
                    self.show = NO;
                }
            }
                break;
            case 7: // 超时未填写结果
            {
                if ([model.feed.author.uid isEqualToString:CurrentUserID]) { // 发布者
                    self.show = YES;
                    {
                        NSString *top = @"我的老板";
                        NSMutableAttributedString *topString = [[NSMutableAttributedString alloc] initWithString:top];
                        topString.font = [UIFont systemFontOfSize:12];
                        topString.color = UIColorHex(A7ABB4);
                        YYTextContainer *textContiner = [YYTextContainer containerWithSize:CGSizeMake(MAXFLOAT, MAXFLOAT)];
                        self.topLabelLayout = [YYTextLayout layoutWithContainer:textContiner text:topString];
                        self.topLabelFrame = CGRectMake(15, 0, self.topLabelLayout.textBoundingRect.size.width, 30);
                    }
                    {
                        self.topLineViewFrame = CGRectMake(16, 30, kScreenWidth - 16, 0.5);
                    }
                    {
                        self.headerImageViewFrame = CGRectMake(15, 41, 30, 30);
                        self.headerImageViewURL = [NSURL URLWithString:model.order.payer.thumbnail];
                    }
                    
                    {
                        if (model.order.tracking.desc.length) {
                            NSMutableAttributedString *descString = [[NSMutableAttributedString alloc] initWithString:model.order.tracking.desc];
                            descString.font = [UIFont systemFontOfSize:12];
                            descString.color = UIColorHex(FFA718);
                            YYTextContainer *container = [YYTextContainer containerWithSize:CGSizeMake(MAXFLOAT, MAXFLOAT)];
                            self.statusLabelLayout = [YYTextLayout layoutWithContainer:container text:descString];
                            self.statusLabelFrame = CGRectMake(kScreenWidth - 15 - self.statusLabelLayout.textBoundingRect.size.width, 47, self.statusLabelLayout.textBoundingRect.size.width, self.statusLabelLayout.textBoundingRect.size.height);
                        } else {
                            self.statusLabelLayout = nil;
                            self.statusLabelFrame = CGRectZero;
                        }
                    }
                    
                    {
                        NSString *userName = model.order.payer.username;
                        NSString *uid = model.order.payer.uid;
                        NSInteger baojiLevel = -1;
                        NSMutableAttributedString *bottomString = [NSMutableAttributedString new];
                        NSMutableAttributedString *nameString = [[NSMutableAttributedString alloc] initWithString:userName];
                        nameString.color = UIColorHex(A7ABB4);
                        nameString.font = [UIFont systemFontOfSize:12];
                        YYTextHighlight *highLight = [YYTextHighlight new];
                        highLight.userInfo = @{kFeedTopClickUser:uid};
                        [nameString setTextHighlight:highLight range:nameString.string.rangeOfAll];
                        [bottomString appendAttributedString:nameString];
                        
                        if (baojiLevel == 100 || baojiLevel == 101 || baojiLevel == 102) {
                            NSAttributedString *bjString = [self attributedStringWithImageSize:CGSizeMake(31, 15) image:[JKRFeedDetailHelper imageNamed:[NSString stringWithFormat:@"bj_%zd", baojiLevel]]];
                            [bottomString appendAttributedString:bjString];
                        }
                        
                        bottomString.lineBreakMode = NSLineBreakByTruncatingMiddle;
                        YYTextContainer *container = [YYTextContainer containerWithSize:CGSizeMake(kScreenWidth - self.statusLabelFrame.size.width - 15 - 55 - 10, MAXFLOAT)];
                        self.userLabelLayout = [YYTextLayout layoutWithContainer:container text:bottomString];
                        self.userLabelFrame = CGRectMake(55, 47 - ((baojiLevel == 100 || baojiLevel == 101 || baojiLevel == 102) ? 16 : 0), self.userLabelLayout.textBoundingRect.size.width, self.userLabelLayout.textBoundingRect.size.height + 2);
                    }
                    
                    self.finishButtonFrame = CGRectZero;
                    self.chatButtonFrame = CGRectMake(kScreenWidth - 15 - 90, 94, 90, 30);
                    self.startButtonFrame = CGRectZero;
                    self.selectButtonFrame = CGRectZero;
                    self.disabledSelectButtonFrame = CGRectZero;
                    
                    {
                        self.bottomLabelFrame = CGRectZero;
                        self.bottomLabelLayout = nil;
                    }
                } else if([model.order.payer.uid isEqualToString:CurrentUserID]) { // 老板
                    self.show = NO;
                } else { // 游客
                    self.show = NO;
                }
            }
                break;
            case 8: // 填写结果-打了
            {
                if ([model.feed.author.uid isEqualToString:CurrentUserID]) { // 发布者
                    self.show = YES;
                    {
                        NSString *top = @"我的老板";
                        NSMutableAttributedString *topString = [[NSMutableAttributedString alloc] initWithString:top];
                        topString.font = [UIFont systemFontOfSize:12];
                        topString.color = UIColorHex(A7ABB4);
                        YYTextContainer *textContiner = [YYTextContainer containerWithSize:CGSizeMake(MAXFLOAT, MAXFLOAT)];
                        self.topLabelLayout = [YYTextLayout layoutWithContainer:textContiner text:topString];
                        self.topLabelFrame = CGRectMake(15, 0, self.topLabelLayout.textBoundingRect.size.width, 30);
                    }
                    {
                        self.topLineViewFrame = CGRectMake(16, 30, kScreenWidth - 16, 0.5);
                    }
                    {
                        self.headerImageViewFrame = CGRectMake(15, 41, 30, 30);
                        self.headerImageViewURL = [NSURL URLWithString:model.order.payer.thumbnail];
                    }
                    
                    {
                        if (model.order.tracking.desc.length) {
                            NSMutableAttributedString *descString = [[NSMutableAttributedString alloc] initWithString:model.order.tracking.desc];
                            descString.font = [UIFont systemFontOfSize:12];
                            descString.color = UIColorHex(FFA718);
                            YYTextContainer *container = [YYTextContainer containerWithSize:CGSizeMake(MAXFLOAT, MAXFLOAT)];
                            self.statusLabelLayout = [YYTextLayout layoutWithContainer:container text:descString];
                            self.statusLabelFrame = CGRectMake(kScreenWidth - 15 - self.statusLabelLayout.textBoundingRect.size.width, 47, self.statusLabelLayout.textBoundingRect.size.width, self.statusLabelLayout.textBoundingRect.size.height);
                        } else {
                            self.statusLabelLayout = nil;
                            self.statusLabelFrame = CGRectZero;
                        }
                    }
                    
                    {
                        NSString *userName = model.order.payer.username;
                        NSString *uid = model.order.payer.uid;
                        NSInteger baojiLevel = -1;
                        NSMutableAttributedString *bottomString = [NSMutableAttributedString new];
                        NSMutableAttributedString *nameString = [[NSMutableAttributedString alloc] initWithString:userName];
                        nameString.color = UIColorHex(A7ABB4);
                        nameString.font = [UIFont systemFontOfSize:12];
                        YYTextHighlight *highLight = [YYTextHighlight new];
                        highLight.userInfo = @{kFeedTopClickUser:uid};
                        [nameString setTextHighlight:highLight range:nameString.string.rangeOfAll];
                        [bottomString appendAttributedString:nameString];
                        
                        if (baojiLevel == 100 || baojiLevel == 101 || baojiLevel == 102) {
                            NSAttributedString *bjString = [self attributedStringWithImageSize:CGSizeMake(31, 15) image:[JKRFeedDetailHelper imageNamed:[NSString stringWithFormat:@"bj_%zd", baojiLevel]]];
                            [bottomString appendAttributedString:bjString];
                        }
                        
                        bottomString.lineBreakMode = NSLineBreakByTruncatingMiddle;
                        YYTextContainer *container = [YYTextContainer containerWithSize:CGSizeMake(kScreenWidth - self.statusLabelFrame.size.width - 15 - 55 - 10, MAXFLOAT)];
                        self.userLabelLayout = [YYTextLayout layoutWithContainer:container text:bottomString];
                        self.userLabelFrame = CGRectMake(55, 47 - ((baojiLevel == 100 || baojiLevel == 101 || baojiLevel == 102) ? 16 : 0), self.userLabelLayout.textBoundingRect.size.width, self.userLabelLayout.textBoundingRect.size.height + 2);
                    }
                    
                    self.finishButtonFrame = CGRectZero;
                    self.chatButtonFrame = CGRectMake(kScreenWidth - 15 - 90, 94, 90, 30);
                    self.startButtonFrame = CGRectZero;
                    self.selectButtonFrame = CGRectZero;
                    self.disabledSelectButtonFrame = CGRectZero;
                    
                    {
                        NSMutableAttributedString *attr = [[NSMutableAttributedString alloc] initWithString:@"快去提醒老板结束服务吧"];
                        attr.font = [UIFont systemFontOfSize:12];
                        attr.color = UIColorHex(A9ACB5);
                        YYTextContainer *container = [YYTextContainer containerWithSize:CGSizeMake(kScreenWidth, MAXFLOAT)];
                        container.maximumNumberOfRows = 1;
                        self.bottomLabelLayout = [YYTextLayout layoutWithContainer:container text:attr];
                        self.bottomLabelFrame = CGRectMake(15, 101, self.bottomLabelLayout.textBoundingRect.size.width, self.bottomLabelLayout.textBoundingRect.size.height);
                    }
                } else if([model.order.payer.uid isEqualToString:CurrentUserID]) { // 老板
                    self.show = NO;
                } else { // 游客
                    self.show = NO;
                }
            }
                break;
            case 9: // 填写结果-没打
            {
                if ([model.feed.author.uid isEqualToString:CurrentUserID]) { // 发布者
                    self.show = YES;
                    {
                        NSString *top = @"我的老板";
                        NSMutableAttributedString *topString = [[NSMutableAttributedString alloc] initWithString:top];
                        topString.font = [UIFont systemFontOfSize:12];
                        topString.color = UIColorHex(A7ABB4);
                        YYTextContainer *textContiner = [YYTextContainer containerWithSize:CGSizeMake(MAXFLOAT, MAXFLOAT)];
                        self.topLabelLayout = [YYTextLayout layoutWithContainer:textContiner text:topString];
                        self.topLabelFrame = CGRectMake(15, 0, self.topLabelLayout.textBoundingRect.size.width, 30);
                    }
                    {
                        self.topLineViewFrame = CGRectMake(16, 30, kScreenWidth - 16, 0.5);
                    }
                    {
                        self.headerImageViewFrame = CGRectMake(15, 41, 30, 30);
                        self.headerImageViewURL = [NSURL URLWithString:model.order.payer.thumbnail];
                    }
                    
                    {
                        if (model.order.tracking.desc.length) {
                            NSMutableAttributedString *descString = [[NSMutableAttributedString alloc] initWithString:model.order.tracking.desc];
                            descString.font = [UIFont systemFontOfSize:12];
                            descString.color = UIColorHex(FFA718);
                            YYTextContainer *container = [YYTextContainer containerWithSize:CGSizeMake(MAXFLOAT, MAXFLOAT)];
                            self.statusLabelLayout = [YYTextLayout layoutWithContainer:container text:descString];
                            self.statusLabelFrame = CGRectMake(kScreenWidth - 15 - self.statusLabelLayout.textBoundingRect.size.width, 47, self.statusLabelLayout.textBoundingRect.size.width, self.statusLabelLayout.textBoundingRect.size.height);
                        } else {
                            self.statusLabelLayout = nil;
                            self.statusLabelFrame = CGRectZero;
                        }
                    }
                    
                    {
                        NSString *userName = model.order.payer.username;
                        NSString *uid = model.order.payer.uid;
                        NSInteger baojiLevel = -1;
                        NSMutableAttributedString *bottomString = [NSMutableAttributedString new];
                        NSMutableAttributedString *nameString = [[NSMutableAttributedString alloc] initWithString:userName];
                        nameString.color = UIColorHex(A7ABB4);
                        nameString.font = [UIFont systemFontOfSize:12];
                        YYTextHighlight *highLight = [YYTextHighlight new];
                        highLight.userInfo = @{kFeedTopClickUser:uid};
                        [nameString setTextHighlight:highLight range:nameString.string.rangeOfAll];
                        [bottomString appendAttributedString:nameString];
                        
                        if (baojiLevel == 100 || baojiLevel == 101 || baojiLevel == 102) {
                            NSAttributedString *bjString = [self attributedStringWithImageSize:CGSizeMake(31, 15) image:[JKRFeedDetailHelper imageNamed:[NSString stringWithFormat:@"bj_%zd", baojiLevel]]];
                            [bottomString appendAttributedString:bjString];
                        }
                        
                        bottomString.lineBreakMode = NSLineBreakByTruncatingMiddle;
                        YYTextContainer *container = [YYTextContainer containerWithSize:CGSizeMake(kScreenWidth - self.statusLabelFrame.size.width - 15 - 55 - 10, MAXFLOAT)];
                        self.userLabelLayout = [YYTextLayout layoutWithContainer:container text:bottomString];
                        self.userLabelFrame = CGRectMake(55, 47 - ((baojiLevel == 100 || baojiLevel == 101 || baojiLevel == 102) ? 16 : 0), self.userLabelLayout.textBoundingRect.size.width, self.userLabelLayout.textBoundingRect.size.height + 2);
                    }
                    
                    self.finishButtonFrame = CGRectZero;
                    self.chatButtonFrame = CGRectMake(kScreenWidth - 15 - 90, 94, 90, 30);
                    self.startButtonFrame = CGRectZero;
                    self.selectButtonFrame = CGRectZero;
                    self.disabledSelectButtonFrame = CGRectZero;
                    
                    {
                        self.bottomLabelFrame = CGRectZero;
                        self.bottomLabelLayout = nil;
                    }
                } else if([model.order.payer.uid isEqualToString:CurrentUserID]) { // 老板
                    self.show = NO;
                } else { // 游客
                    self.show = NO;
                }
            }
                break;
            case 10: // 填写打了超时未确认或者确认服务
            {
                if ([model.feed.author.uid isEqualToString:CurrentUserID]) { // 发布者
                    self.show = YES;
                    {
                        NSString *top = @"我的老板";
                        NSMutableAttributedString *topString = [[NSMutableAttributedString alloc] initWithString:top];
                        topString.font = [UIFont systemFontOfSize:12];
                        topString.color = UIColorHex(A7ABB4);
                        YYTextContainer *textContiner = [YYTextContainer containerWithSize:CGSizeMake(MAXFLOAT, MAXFLOAT)];
                        self.topLabelLayout = [YYTextLayout layoutWithContainer:textContiner text:topString];
                        self.topLabelFrame = CGRectMake(15, 0, self.topLabelLayout.textBoundingRect.size.width, 30);
                    }
                    {
                        self.topLineViewFrame = CGRectMake(16, 30, kScreenWidth - 16, 0.5);
                    }
                    {
                        self.headerImageViewFrame = CGRectMake(15, 41, 30, 30);
                        self.headerImageViewURL = [NSURL URLWithString:model.order.payer.thumbnail];
                    }
                    
                    {
                        if (model.order.tracking.desc.length) {
                            NSMutableAttributedString *descString = [[NSMutableAttributedString alloc] initWithString:model.order.tracking.desc];
                            descString.font = [UIFont systemFontOfSize:12];
                            descString.color = UIColorHex(FFA718);
                            YYTextContainer *container = [YYTextContainer containerWithSize:CGSizeMake(MAXFLOAT, MAXFLOAT)];
                            self.statusLabelLayout = [YYTextLayout layoutWithContainer:container text:descString];
                            self.statusLabelFrame = CGRectMake(kScreenWidth - 15 - self.statusLabelLayout.textBoundingRect.size.width, 47, self.statusLabelLayout.textBoundingRect.size.width, self.statusLabelLayout.textBoundingRect.size.height);
                        } else {
                            self.statusLabelLayout = nil;
                            self.statusLabelFrame = CGRectZero;
                        }
                    }
                    
                    {
                        NSString *userName = model.order.payer.username;
                        NSString *uid = model.order.payer.uid;
                        NSInteger baojiLevel = -1;
                        NSMutableAttributedString *bottomString = [NSMutableAttributedString new];
                        NSMutableAttributedString *nameString = [[NSMutableAttributedString alloc] initWithString:userName];
                        nameString.color = UIColorHex(A7ABB4);
                        nameString.font = [UIFont systemFontOfSize:12];
                        YYTextHighlight *highLight = [YYTextHighlight new];
                        highLight.userInfo = @{kFeedTopClickUser:uid};
                        [nameString setTextHighlight:highLight range:nameString.string.rangeOfAll];
                        [bottomString appendAttributedString:nameString];
                        
                        if (baojiLevel == 100 || baojiLevel == 101 || baojiLevel == 102) {
                            NSAttributedString *bjString = [self attributedStringWithImageSize:CGSizeMake(31, 15) image:[JKRFeedDetailHelper imageNamed:[NSString stringWithFormat:@"bj_%zd", baojiLevel]]];
                            [bottomString appendAttributedString:bjString];
                        }
                        
                        bottomString.lineBreakMode = NSLineBreakByTruncatingMiddle;
                        YYTextContainer *container = [YYTextContainer containerWithSize:CGSizeMake(kScreenWidth - self.statusLabelFrame.size.width - 15 - 55 - 10, MAXFLOAT)];
                        self.userLabelLayout = [YYTextLayout layoutWithContainer:container text:bottomString];
                        self.userLabelFrame = CGRectMake(55, 47 - ((baojiLevel == 100 || baojiLevel == 101 || baojiLevel == 102) ? 16 : 0), self.userLabelLayout.textBoundingRect.size.width, self.userLabelLayout.textBoundingRect.size.height + 2);
                    }
                    
                    self.finishButtonFrame = CGRectZero;
                    self.chatButtonFrame = CGRectMake(kScreenWidth - 15 - 90, 94, 90, 30);
                    self.startButtonFrame = CGRectZero;
                    self.selectButtonFrame = CGRectZero;
                    self.disabledSelectButtonFrame = CGRectZero;
                    
                    {
                        self.bottomLabelFrame = CGRectZero;
                        self.bottomLabelLayout = nil;
                    }
                } else if([model.order.payer.uid isEqualToString:CurrentUserID]) { // 老板
                    self.show = NO;
                } else { // 游客
                    self.show = NO;
                }
            }
                break;
            case 11: // 发起投诉
            {
                if ([model.feed.author.uid isEqualToString:CurrentUserID]) { // 发布者
                    self.show = YES;
                    {
                        NSString *top = @"我的老板";
                        NSMutableAttributedString *topString = [[NSMutableAttributedString alloc] initWithString:top];
                        topString.font = [UIFont systemFontOfSize:12];
                        topString.color = UIColorHex(A7ABB4);
                        YYTextContainer *textContiner = [YYTextContainer containerWithSize:CGSizeMake(MAXFLOAT, MAXFLOAT)];
                        self.topLabelLayout = [YYTextLayout layoutWithContainer:textContiner text:topString];
                        self.topLabelFrame = CGRectMake(15, 0, self.topLabelLayout.textBoundingRect.size.width, 30);
                    }
                    {
                        self.topLineViewFrame = CGRectMake(16, 30, kScreenWidth - 16, 0.5);
                    }
                    {
                        self.headerImageViewFrame = CGRectMake(15, 41, 30, 30);
                        self.headerImageViewURL = [NSURL URLWithString:model.order.payer.thumbnail];
                    }
                    
                    {
                        if (model.order.tracking.desc.length) {
                            NSMutableAttributedString *descString = [[NSMutableAttributedString alloc] initWithString:model.order.tracking.desc];
                            descString.font = [UIFont systemFontOfSize:12];
                            descString.color = UIColorHex(FFA718);
                            YYTextContainer *container = [YYTextContainer containerWithSize:CGSizeMake(MAXFLOAT, MAXFLOAT)];
                            self.statusLabelLayout = [YYTextLayout layoutWithContainer:container text:descString];
                            self.statusLabelFrame = CGRectMake(kScreenWidth - 15 - self.statusLabelLayout.textBoundingRect.size.width, 47, self.statusLabelLayout.textBoundingRect.size.width, self.statusLabelLayout.textBoundingRect.size.height);
                        } else {
                            self.statusLabelLayout = nil;
                            self.statusLabelFrame = CGRectZero;
                        }
                    }
                    
                    {
                        NSString *userName = model.order.payer.username;
                        NSString *uid = model.order.payer.uid;
                        NSInteger baojiLevel = -1;
                        NSMutableAttributedString *bottomString = [NSMutableAttributedString new];
                        NSMutableAttributedString *nameString = [[NSMutableAttributedString alloc] initWithString:userName];
                        nameString.color = UIColorHex(A7ABB4);
                        nameString.font = [UIFont systemFontOfSize:12];
                        YYTextHighlight *highLight = [YYTextHighlight new];
                        highLight.userInfo = @{kFeedTopClickUser:uid};
                        [nameString setTextHighlight:highLight range:nameString.string.rangeOfAll];
                        [bottomString appendAttributedString:nameString];
                        
                        if (baojiLevel == 100 || baojiLevel == 101 || baojiLevel == 102) {
                            NSAttributedString *bjString = [self attributedStringWithImageSize:CGSizeMake(31, 15) image:[JKRFeedDetailHelper imageNamed:[NSString stringWithFormat:@"bj_%zd", baojiLevel]]];
                            [bottomString appendAttributedString:bjString];
                        }
                        
                        bottomString.lineBreakMode = NSLineBreakByTruncatingMiddle;
                        YYTextContainer *container = [YYTextContainer containerWithSize:CGSizeMake(kScreenWidth - self.statusLabelFrame.size.width - 15 - 55 - 10, MAXFLOAT)];
                        self.userLabelLayout = [YYTextLayout layoutWithContainer:container text:bottomString];
                        self.userLabelFrame = CGRectMake(55, 47 - ((baojiLevel == 100 || baojiLevel == 101 || baojiLevel == 102) ? 16 : 0), self.userLabelLayout.textBoundingRect.size.width, self.userLabelLayout.textBoundingRect.size.height + 2);
                    }
                    
                    self.finishButtonFrame = CGRectZero;
                    self.chatButtonFrame = CGRectMake(kScreenWidth - 15 - 90, 94, 90, 30);
                    self.startButtonFrame = CGRectZero;
                    self.selectButtonFrame = CGRectZero;
                    self.disabledSelectButtonFrame = CGRectZero;
                    
                    {
                        self.bottomLabelFrame = CGRectZero;
                        self.bottomLabelLayout = nil;
                    }
                } else if([model.order.payer.uid isEqualToString:CurrentUserID]) { // 老板
                    self.show = NO;
                } else { // 游客
                    self.show = NO;
                }
            }
                break;
            case 12: // 申诉成功
            {
                if ([model.feed.author.uid isEqualToString:CurrentUserID]) { // 发布者
                    self.show = YES;
                    {
                        NSString *top = @"我的老板";
                        NSMutableAttributedString *topString = [[NSMutableAttributedString alloc] initWithString:top];
                        topString.font = [UIFont systemFontOfSize:12];
                        topString.color = UIColorHex(A7ABB4);
                        YYTextContainer *textContiner = [YYTextContainer containerWithSize:CGSizeMake(MAXFLOAT, MAXFLOAT)];
                        self.topLabelLayout = [YYTextLayout layoutWithContainer:textContiner text:topString];
                        self.topLabelFrame = CGRectMake(15, 0, self.topLabelLayout.textBoundingRect.size.width, 30);
                    }
                    {
                        self.topLineViewFrame = CGRectMake(16, 30, kScreenWidth - 16, 0.5);
                    }
                    {
                        self.headerImageViewFrame = CGRectMake(15, 41, 30, 30);
                        self.headerImageViewURL = [NSURL URLWithString:model.order.payer.thumbnail];
                    }
                    
                    {
                        if (model.order.tracking.desc.length) {
                            NSMutableAttributedString *descString = [[NSMutableAttributedString alloc] initWithString:model.order.tracking.desc];
                            descString.font = [UIFont systemFontOfSize:12];
                            descString.color = UIColorHex(FFA718);
                            YYTextContainer *container = [YYTextContainer containerWithSize:CGSizeMake(MAXFLOAT, MAXFLOAT)];
                            self.statusLabelLayout = [YYTextLayout layoutWithContainer:container text:descString];
                            self.statusLabelFrame = CGRectMake(kScreenWidth - 15 - self.statusLabelLayout.textBoundingRect.size.width, 47, self.statusLabelLayout.textBoundingRect.size.width, self.statusLabelLayout.textBoundingRect.size.height);
                        } else {
                            self.statusLabelLayout = nil;
                            self.statusLabelFrame = CGRectZero;
                        }
                    }
                    
                    {
                        NSString *userName = model.order.payer.username;
                        NSString *uid = model.order.payer.uid;
                        NSInteger baojiLevel = -1;
                        NSMutableAttributedString *bottomString = [NSMutableAttributedString new];
                        NSMutableAttributedString *nameString = [[NSMutableAttributedString alloc] initWithString:userName];
                        nameString.color = UIColorHex(A7ABB4);
                        nameString.font = [UIFont systemFontOfSize:12];
                        YYTextHighlight *highLight = [YYTextHighlight new];
                        highLight.userInfo = @{kFeedTopClickUser:uid};
                        [nameString setTextHighlight:highLight range:nameString.string.rangeOfAll];
                        [bottomString appendAttributedString:nameString];
                        
                        if (baojiLevel == 100 || baojiLevel == 101 || baojiLevel == 102) {
                            NSAttributedString *bjString = [self attributedStringWithImageSize:CGSizeMake(31, 15) image:[JKRFeedDetailHelper imageNamed:[NSString stringWithFormat:@"bj_%zd", baojiLevel]]];
                            [bottomString appendAttributedString:bjString];
                        }
                        
                        bottomString.lineBreakMode = NSLineBreakByTruncatingMiddle;
                        YYTextContainer *container = [YYTextContainer containerWithSize:CGSizeMake(kScreenWidth - self.statusLabelFrame.size.width - 15 - 55 - 10, MAXFLOAT)];
                        self.userLabelLayout = [YYTextLayout layoutWithContainer:container text:bottomString];
                        self.userLabelFrame = CGRectMake(55, 47 - ((baojiLevel == 100 || baojiLevel == 101 || baojiLevel == 102) ? 16 : 0), self.userLabelLayout.textBoundingRect.size.width, self.userLabelLayout.textBoundingRect.size.height + 2);
                    }
                    
                    self.finishButtonFrame = CGRectZero;
                    self.chatButtonFrame = CGRectMake(kScreenWidth - 15 - 90, 94, 90, 30);
                    self.startButtonFrame = CGRectZero;
                    self.selectButtonFrame = CGRectZero;
                    self.disabledSelectButtonFrame = CGRectZero;
                    
                    {
                        self.bottomLabelFrame = CGRectZero;
                        self.bottomLabelLayout = nil;
                    }
                } else if([model.order.payer.uid isEqualToString:CurrentUserID]) { // 老板
                    self.show = NO;
                } else { // 游客
                    self.show = NO;
                }
            }
                break;
            case 13: // 申诉失败
            {
                if ([model.feed.author.uid isEqualToString:CurrentUserID]) { // 发布者
                    self.show = YES;
                    {
                        NSString *top = @"我的老板";
                        NSMutableAttributedString *topString = [[NSMutableAttributedString alloc] initWithString:top];
                        topString.font = [UIFont systemFontOfSize:12];
                        topString.color = UIColorHex(A7ABB4);
                        YYTextContainer *textContiner = [YYTextContainer containerWithSize:CGSizeMake(MAXFLOAT, MAXFLOAT)];
                        self.topLabelLayout = [YYTextLayout layoutWithContainer:textContiner text:topString];
                        self.topLabelFrame = CGRectMake(15, 0, self.topLabelLayout.textBoundingRect.size.width, 30);
                    }
                    {
                        self.topLineViewFrame = CGRectMake(16, 30, kScreenWidth - 16, 0.5);
                    }
                    {
                        self.headerImageViewFrame = CGRectMake(15, 41, 30, 30);
                        self.headerImageViewURL = [NSURL URLWithString:model.order.payer.thumbnail];
                    }
                    
                    {
                        if (model.order.tracking.desc.length) {
                            NSMutableAttributedString *descString = [[NSMutableAttributedString alloc] initWithString:model.order.tracking.desc];
                            descString.font = [UIFont systemFontOfSize:12];
                            descString.color = UIColorHex(FFA718);
                            YYTextContainer *container = [YYTextContainer containerWithSize:CGSizeMake(MAXFLOAT, MAXFLOAT)];
                            self.statusLabelLayout = [YYTextLayout layoutWithContainer:container text:descString];
                            self.statusLabelFrame = CGRectMake(kScreenWidth - 15 - self.statusLabelLayout.textBoundingRect.size.width, 47, self.statusLabelLayout.textBoundingRect.size.width, self.statusLabelLayout.textBoundingRect.size.height);
                        } else {
                            self.statusLabelLayout = nil;
                            self.statusLabelFrame = CGRectZero;
                        }
                    }
                    
                    {
                        NSString *userName = model.order.payer.username;
                        NSString *uid = model.order.payer.uid;
                        NSInteger baojiLevel = -1;
                        NSMutableAttributedString *bottomString = [NSMutableAttributedString new];
                        NSMutableAttributedString *nameString = [[NSMutableAttributedString alloc] initWithString:userName];
                        nameString.color = UIColorHex(A7ABB4);
                        nameString.font = [UIFont systemFontOfSize:12];
                        YYTextHighlight *highLight = [YYTextHighlight new];
                        highLight.userInfo = @{kFeedTopClickUser:uid};
                        [nameString setTextHighlight:highLight range:nameString.string.rangeOfAll];
                        [bottomString appendAttributedString:nameString];
                        
                        if (baojiLevel == 100 || baojiLevel == 101 || baojiLevel == 102) {
                            NSAttributedString *bjString = [self attributedStringWithImageSize:CGSizeMake(31, 15) image:[JKRFeedDetailHelper imageNamed:[NSString stringWithFormat:@"bj_%zd", baojiLevel]]];
                            [bottomString appendAttributedString:bjString];
                        }
                        
                        bottomString.lineBreakMode = NSLineBreakByTruncatingMiddle;
                        YYTextContainer *container = [YYTextContainer containerWithSize:CGSizeMake(kScreenWidth - self.statusLabelFrame.size.width - 15 - 55 - 10, MAXFLOAT)];
                        self.userLabelLayout = [YYTextLayout layoutWithContainer:container text:bottomString];
                        self.userLabelFrame = CGRectMake(55, 47 - ((baojiLevel == 100 || baojiLevel == 101 || baojiLevel == 102) ? 16 : 0), self.userLabelLayout.textBoundingRect.size.width, self.userLabelLayout.textBoundingRect.size.height + 2);
                    }
                    
                    self.finishButtonFrame = CGRectZero;
                    self.chatButtonFrame = CGRectMake(kScreenWidth - 15 - 90, 94, 90, 30);
                    self.startButtonFrame = CGRectZero;
                    self.selectButtonFrame = CGRectZero;
                    self.disabledSelectButtonFrame = CGRectZero;
                    
                    {
                        self.bottomLabelFrame = CGRectZero;
                        self.bottomLabelLayout = nil;
                    }
                } else if([model.order.payer.uid isEqualToString:CurrentUserID]) { // 老板
                    self.show = NO;
                } else { // 游客
                    self.show = NO;
                }
            }
                break;
            default:
                break;
        }
    } else if (model.order.order_type == 2) { // 约玩
        switch (model.order.order_status) {
            case 1: // 已发布
            {
                BOOL isSignUp = NO;
                for (JKRFeedOrderCandidate *candidate in model.order.candidates) {
                    if ([candidate.uid isEqualToString:CurrentUserID]) {
                        isSignUp = YES;
                        break;
                    }
                }
                if ([model.feed.author.uid isEqualToString:CurrentUserID]) { // 发布者
                    if (model.order.candidates) {
                        self.show = YES;
                        
                        {
                            NSString *top = @"我的接单大神";
                            NSMutableAttributedString *topString = [[NSMutableAttributedString alloc] initWithString:top];
                            topString.font = [UIFont systemFontOfSize:12];
                            topString.color = UIColorHex(A7ABB4);
                            YYTextContainer *textContiner = [YYTextContainer containerWithSize:CGSizeMake(MAXFLOAT, MAXFLOAT)];
                            self.topLabelLayout = [YYTextLayout layoutWithContainer:textContiner text:topString];
                            self.topLabelFrame = CGRectMake(15, 0, self.topLabelLayout.textBoundingRect.size.width, 30);
                        }
                        {
                            self.topLineViewFrame = CGRectMake(16, 30, kScreenWidth - 16, 0.5);
                        }
                        {
                            self.headerImageViewFrame = CGRectZero;
                            self.headerImageViewURL = nil;
                        }
                        
                        {
                            if (model.order.tracking.desc.length) {
                                NSMutableAttributedString *descString = [[NSMutableAttributedString alloc] initWithString:model.order.tracking.desc];
                                descString.font = [UIFont systemFontOfSize:12];
                                descString.color = UIColorHex(FFA718);
                                YYTextContainer *container = [YYTextContainer containerWithSize:CGSizeMake(MAXFLOAT, MAXFLOAT)];
                                self.statusLabelLayout = [YYTextLayout layoutWithContainer:container text:descString];
                                self.statusLabelFrame = CGRectMake(kScreenWidth - 15 - self.statusLabelLayout.textBoundingRect.size.width, 47, self.statusLabelLayout.textBoundingRect.size.width, self.statusLabelLayout.textBoundingRect.size.height);
                            } else {
                                self.statusLabelLayout = nil;
                                self.statusLabelFrame = CGRectZero;
                            }
                        }
                        
                        {
                            NSMutableAttributedString *voteUserString = [NSMutableAttributedString new];
                            CGFloat textWith = kScreenWidth - self.statusLabelFrame.size.width - 15 - 15 - 44;
                            NSInteger maxCount = ((NSInteger)textWith) / 25;
                            NSInteger showCount = maxCount < model.order.candidates.count ? (maxCount - 1) : model.order.candidates.count;
                            for (NSInteger i = 0; i < showCount; i ++) {
                                JKRFeedOrderCandidate *userModel = model.order.candidates[i];
                                NSAttributedString *pic = [NSAttributedString circleHeader_attributedStringWithFontSize:20 imageURL:userModel.thumbnail shrink:NO];
                                YYTextHighlight *highLight = [YYTextHighlight new];
                                highLight.userInfo = @{kFeedTopClickUser:userModel.uid};
                                NSMutableAttributedString *picM = [[NSMutableAttributedString alloc] initWithAttributedString:pic];
                                [picM setTextHighlight:highLight range:picM.string.rangeOfAll];
                                [voteUserString appendAttributedString:picM];
                                [voteUserString appendAttributedString:[[NSMutableAttributedString alloc] initWithString:@" "]];
                            }
                            
                            if (maxCount < model.order.candidates.count) {
                                NSAttributedString *pic = [NSAttributedString original_attributedStringWithFontSize:20 image:[JKRFeedDetailHelper imageNamed:@"more_fxsy"] shrink:NO];
                                [voteUserString appendAttributedString:pic];
                                YYTextHighlight *highLight = [YYTextHighlight new];
                                highLight.userInfo = @{kFeedTopClickCandidateList:kFeedTopClickCandidateList};
                                [voteUserString setTextHighlight:highLight range:NSMakeRange(voteUserString.length - pic.length, pic.length)];
                            }
                            
                            YYTextContainer *container = [YYTextContainer containerWithSize:CGSizeMake(textWith, MAXFLOAT)];
                            self.userLabelLayout = [YYTextLayout layoutWithContainer:container text:voteUserString];
                            self.userLabelFrame = CGRectMake(15, 45, self.userLabelLayout.textBoundingRect.size.width, self.userLabelLayout.textBoundingRect.size.height);
                        }
                        
                        {
                            self.bottomLabelFrame = CGRectZero;
                            self.bottomLabelLayout = nil;
                        }
                        
                        
                        self.finishButtonFrame = CGRectZero;
                        self.chatButtonFrame = CGRectZero;
                        self.startButtonFrame = CGRectZero;
                        self.selectButtonFrame = CGRectMake(kScreenWidth - 15 - 90, 94, 90, 30);
                        self.disabledSelectButtonFrame = CGRectZero;
                        
                        {
                            NSMutableAttributedString *tail = [[NSMutableAttributedString alloc] initWithString:[NSString stringWithFormat:@"%zd位大神已加入接单", model.order.candidates.count]];
                            tail.font = [UIFont systemFontOfSize:11];
                            tail.color = UIColorHex(A7ABB4);
                            YYTextContainer *container = [YYTextContainer containerWithSize:CGSizeMake(kScreenWidth - 30, MAXFLOAT)];
                            
                            self.bottomLabelLayout = [YYTextLayout layoutWithContainer:container text:tail];
                            self.bottomLabelFrame = CGRectMake(15, CGRectGetMaxY(self.userLabelFrame) + 5, self.bottomLabelLayout.textBoundingRect.size.width, self.bottomLabelLayout.textBoundingRect.size.height);
                        }
                    } else {
                        self.show = NO;
                    }
                } else if(isSignUp) { // 报名者
                    self.show = NO;
                } else { // 游客
                    self.show = NO;
                }
            }
                break;
            case 2: // 超时无人报名
            {
                BOOL isSignUp = NO;
                for (JKRFeedOrderCandidate *candidate in model.order.candidates) {
                    if ([candidate.uid isEqualToString:CurrentUserID]) {
                        isSignUp = YES;
                        break;
                    }
                }
                if ([model.feed.author.uid isEqualToString:CurrentUserID]) { // 发布者
                    self.show = NO;
                } else if(isSignUp) { // 报名者
                    self.show = NO;
                } else { // 游客
                    self.show = NO;
                }
            }
                break;
            case 3: // 超时未选大神
            {
                BOOL isSignUp = NO;
                for (JKRFeedOrderCandidate *candidate in model.order.candidates) {
                    if ([candidate.uid isEqualToString:CurrentUserID]) {
                        isSignUp = YES;
                        break;
                    }
                }
                if ([model.feed.author.uid isEqualToString:CurrentUserID]) { // 发布者
                    if (model.order.candidates) {
                        self.show = YES;
                        
                        {
                            NSString *top = @"我的接单大神";
                            NSMutableAttributedString *topString = [[NSMutableAttributedString alloc] initWithString:top];
                            topString.font = [UIFont systemFontOfSize:12];
                            topString.color = UIColorHex(A7ABB4);
                            YYTextContainer *textContiner = [YYTextContainer containerWithSize:CGSizeMake(MAXFLOAT, MAXFLOAT)];
                            self.topLabelLayout = [YYTextLayout layoutWithContainer:textContiner text:topString];
                            self.topLabelFrame = CGRectMake(15, 0, self.topLabelLayout.textBoundingRect.size.width, 30);
                        }
                        {
                            self.topLineViewFrame = CGRectMake(16, 30, kScreenWidth - 16, 0.5);
                        }
                        {
                            self.headerImageViewFrame = CGRectZero;
                            self.headerImageViewURL = nil;
                        }
                        
                        {
                            if (model.order.tracking.desc.length) {
                                NSMutableAttributedString *descString = [[NSMutableAttributedString alloc] initWithString:model.order.tracking.desc];
                                descString.font = [UIFont systemFontOfSize:12];
                                descString.color = UIColorHex(FFA718);
                                YYTextContainer *container = [YYTextContainer containerWithSize:CGSizeMake(MAXFLOAT, MAXFLOAT)];
                                self.statusLabelLayout = [YYTextLayout layoutWithContainer:container text:descString];
                                self.statusLabelFrame = CGRectMake(kScreenWidth - 15 - self.statusLabelLayout.textBoundingRect.size.width, 47, self.statusLabelLayout.textBoundingRect.size.width, self.statusLabelLayout.textBoundingRect.size.height);
                            } else {
                                self.statusLabelLayout = nil;
                                self.statusLabelFrame = CGRectZero;
                            }
                        }
                        
                        {
                            NSMutableAttributedString *voteUserString = [NSMutableAttributedString new];
                            CGFloat textWith = kScreenWidth - self.statusLabelFrame.size.width - 15 - 15 - 44;
                            NSInteger maxCount = ((NSInteger)textWith) / 25;
                            NSInteger showCount = maxCount < model.order.candidates.count ? (maxCount - 1) : model.order.candidates.count;
                            for (NSInteger i = 0; i < showCount; i ++) {
                                JKRFeedOrderCandidate *userModel = model.order.candidates[i];
                                NSAttributedString *pic = [NSAttributedString circleHeader_attributedStringWithFontSize:20 imageURL:userModel.thumbnail shrink:NO];
                                YYTextHighlight *highLight = [YYTextHighlight new];
                                highLight.userInfo = @{kFeedTopClickUser:userModel.uid};
                                NSMutableAttributedString *picM = [[NSMutableAttributedString alloc] initWithAttributedString:pic];
                                [picM setTextHighlight:highLight range:picM.string.rangeOfAll];
                                [voteUserString appendAttributedString:picM];
                                [voteUserString appendAttributedString:[[NSMutableAttributedString alloc] initWithString:@" "]];
                            }
                            
                            if (maxCount < model.order.candidates.count) {
                                NSAttributedString *pic = [NSAttributedString original_attributedStringWithFontSize:20 image:[JKRFeedDetailHelper imageNamed:@"more_fxsy"] shrink:NO];
                                [voteUserString appendAttributedString:pic];
                                YYTextHighlight *highLight = [YYTextHighlight new];
                                highLight.userInfo = @{kFeedTopClickCandidateList:kFeedTopClickCandidateList};
                                [voteUserString setTextHighlight:highLight range:NSMakeRange(voteUserString.length - pic.length, pic.length)];
                            }
                            
                            YYTextContainer *container = [YYTextContainer containerWithSize:CGSizeMake(textWith, MAXFLOAT)];
                            self.userLabelLayout = [YYTextLayout layoutWithContainer:container text:voteUserString];
                            self.userLabelFrame = CGRectMake(15, 45, self.userLabelLayout.textBoundingRect.size.width, self.userLabelLayout.textBoundingRect.size.height);
                        }
                        
                        {
                            self.bottomLabelFrame = CGRectZero;
                            self.bottomLabelLayout = nil;
                        }
                        
                        self.finishButtonFrame = CGRectZero;
                        self.chatButtonFrame = CGRectZero;
                        self.startButtonFrame = CGRectZero;
                        self.selectButtonFrame = CGRectZero;
                        self.disabledSelectButtonFrame = CGRectMake(kScreenWidth - 15 - 90, 94, 90, 30);
                        {
                            NSMutableAttributedString *tail = [[NSMutableAttributedString alloc] initWithString:[NSString stringWithFormat:@"%zd位大神已加入接单", model.order.candidates.count]];
                            tail.font = [UIFont systemFontOfSize:11];
                            tail.color = UIColorHex(A7ABB4);
                            YYTextContainer *container = [YYTextContainer containerWithSize:CGSizeMake(kScreenWidth - 30, MAXFLOAT)];
                            
                            self.bottomLabelLayout = [YYTextLayout layoutWithContainer:container text:tail];
                            self.bottomLabelFrame = CGRectMake(15, CGRectGetMaxY(self.userLabelFrame) + 5, self.bottomLabelLayout.textBoundingRect.size.width, self.bottomLabelLayout.textBoundingRect.size.height);
                        }
                    } else {
                        self.show = NO;
                    }
                } else if(isSignUp) { // 报名者
                    self.show = NO;
                } else { // 游客
                    self.show = NO;
                }
            }
                break;
            case 5: // 选择大神
            {
                if ([model.feed.author.uid isEqualToString:CurrentUserID]) { // 发布者
                    self.show = YES;
                    {
                        NSString *top = @"我的接单大神";
                        NSMutableAttributedString *topString = [[NSMutableAttributedString alloc] initWithString:top];
                        topString.font = [UIFont systemFontOfSize:12];
                        topString.color = UIColorHex(A7ABB4);
                        YYTextContainer *textContiner = [YYTextContainer containerWithSize:CGSizeMake(MAXFLOAT, MAXFLOAT)];
                        self.topLabelLayout = [YYTextLayout layoutWithContainer:textContiner text:topString];
                        self.topLabelFrame = CGRectMake(15, 0, self.topLabelLayout.textBoundingRect.size.width, 30);
                    }
                    {
                        self.topLineViewFrame = CGRectMake(16, 30, kScreenWidth - 16, 0.5);
                    }
                    {
                        self.headerImageViewFrame = CGRectMake(15, 41, 30, 30);
                        self.headerImageViewURL = [NSURL URLWithString:model.order.candidate.thumbnail];
                    }
                    
                    {
                        self.statusLabelLayout = nil;
                        self.statusLabelFrame = CGRectZero;
                    }
                    
                    {
                        NSString *userName = model.order.candidate.username;
                        NSString *uid = model.order.candidate.uid;
                        NSInteger baojiLevel = [model.order.candidate.identity integerValue];
                        baojiLevel = 100;
                        NSMutableAttributedString *bottomString = [NSMutableAttributedString new];
                        NSMutableAttributedString *nameString = [[NSMutableAttributedString alloc] initWithString:userName];
                        nameString.color = UIColorHex(A7ABB4);
                        nameString.font = [UIFont systemFontOfSize:12];
                        YYTextHighlight *highLight = [YYTextHighlight new];
                        highLight.userInfo = @{kFeedTopClickUser:uid};
                        [nameString setTextHighlight:highLight range:nameString.string.rangeOfAll];
                        [bottomString appendAttributedString:nameString];
                        
                        if (baojiLevel == 100 || baojiLevel == 101 || baojiLevel == 102) {
                            NSAttributedString *bjString = [self attributedStringWithImageSize:CGSizeMake(31, 15) image:[JKRFeedDetailHelper imageNamed:[NSString stringWithFormat:@"bj_%zd", baojiLevel]]];
                            [bottomString appendAttributedString:bjString];
                        }
                        
                        bottomString.lineBreakMode = NSLineBreakByTruncatingMiddle;
                        YYTextContainer *container = [YYTextContainer containerWithSize:CGSizeMake(kScreenWidth - self.statusLabelFrame.size.width - 15 - 55 - 10, MAXFLOAT)];
                        self.userLabelLayout = [YYTextLayout layoutWithContainer:container text:bottomString];
                        self.userLabelFrame = CGRectMake(55, 47 - ((baojiLevel == 100 || baojiLevel == 101 || baojiLevel == 102) ? 16 : 0), self.userLabelLayout.textBoundingRect.size.width, self.userLabelLayout.textBoundingRect.size.height + 2);
                    }
                    
                    self.finishButtonFrame = CGRectZero;
                    self.chatButtonFrame = CGRectMake(kScreenWidth - 15 - 90, 94, 90, 30);
                    self.startButtonFrame = CGRectZero;
                    self.selectButtonFrame = CGRectZero;
                    self.disabledSelectButtonFrame = CGRectZero;
                    
                    {
                        self.bottomLabelFrame = CGRectZero;
                        self.bottomLabelLayout = nil;
                    }
                } else if ([model.order.candidate.uid isEqualToString:CurrentUserID]) { // 大神
                    self.show = NO;
                } else { // 游客
                    self.show = NO;
                }
            }
                break;
            case 7: // 超时未填写结果
            {
                if ([model.feed.author.uid isEqualToString:CurrentUserID]) { // 发布者
                    self.show = YES;
                    {
                        NSString *top = @"我的接单大神";
                        NSMutableAttributedString *topString = [[NSMutableAttributedString alloc] initWithString:top];
                        topString.font = [UIFont systemFontOfSize:12];
                        topString.color = UIColorHex(A7ABB4);
                        YYTextContainer *textContiner = [YYTextContainer containerWithSize:CGSizeMake(MAXFLOAT, MAXFLOAT)];
                        self.topLabelLayout = [YYTextLayout layoutWithContainer:textContiner text:topString];
                        self.topLabelFrame = CGRectMake(15, 0, self.topLabelLayout.textBoundingRect.size.width, 30);
                    }
                    {
                        self.topLineViewFrame = CGRectMake(16, 30, kScreenWidth - 16, 0.5);
                    }
                    {
                        self.headerImageViewFrame = CGRectMake(15, 41, 30, 30);
                        self.headerImageViewURL = [NSURL URLWithString:model.order.candidate.thumbnail];
                    }
                    
                    {
                        if (model.order.tracking.desc.length) {
                            NSMutableAttributedString *descString = [[NSMutableAttributedString alloc] initWithString:model.order.tracking.desc];
                            descString.font = [UIFont systemFontOfSize:12];
                            descString.color = UIColorHex(FFA718);
                            YYTextContainer *container = [YYTextContainer containerWithSize:CGSizeMake(MAXFLOAT, MAXFLOAT)];
                            self.statusLabelLayout = [YYTextLayout layoutWithContainer:container text:descString];
                            self.statusLabelFrame = CGRectMake(kScreenWidth - 15 - self.statusLabelLayout.textBoundingRect.size.width, 47, self.statusLabelLayout.textBoundingRect.size.width, self.statusLabelLayout.textBoundingRect.size.height);
                        } else {
                            self.statusLabelLayout = nil;
                            self.statusLabelFrame = CGRectZero;
                        }
                    }
                    
                    {
                        NSString *userName = model.order.candidate.username;
                        NSString *uid = model.order.candidate.uid;
                        NSInteger baojiLevel = 100;
                        NSMutableAttributedString *bottomString = [NSMutableAttributedString new];
                        NSMutableAttributedString *nameString = [[NSMutableAttributedString alloc] initWithString:userName];
                        nameString.color = UIColorHex(A7ABB4);
                        nameString.font = [UIFont systemFontOfSize:12];
                        YYTextHighlight *highLight = [YYTextHighlight new];
                        highLight.userInfo = @{kFeedTopClickUser:uid};
                        [nameString setTextHighlight:highLight range:nameString.string.rangeOfAll];
                        [bottomString appendAttributedString:nameString];
                        
                        if (baojiLevel == 100 || baojiLevel == 101 || baojiLevel == 102) {
                            NSAttributedString *bjString = [self attributedStringWithImageSize:CGSizeMake(31, 15) image:[JKRFeedDetailHelper imageNamed:[NSString stringWithFormat:@"bj_%zd", baojiLevel]]];
                            [bottomString appendAttributedString:bjString];
                        }
                        
                        bottomString.lineBreakMode = NSLineBreakByTruncatingMiddle;
                        YYTextContainer *container = [YYTextContainer containerWithSize:CGSizeMake(kScreenWidth - self.statusLabelFrame.size.width - 15 - 55 - 10, MAXFLOAT)];
                        self.userLabelLayout = [YYTextLayout layoutWithContainer:container text:bottomString];
                        self.userLabelFrame = CGRectMake(55, 47 - ((baojiLevel == 100 || baojiLevel == 101 || baojiLevel == 102) ? 16 : 0), self.userLabelLayout.textBoundingRect.size.width, self.userLabelLayout.textBoundingRect.size.height + 2);
                    }
                    
                    self.finishButtonFrame = CGRectZero;
                    self.chatButtonFrame = CGRectMake(kScreenWidth - 15 - 90, 94, 90, 30);
                    self.startButtonFrame = CGRectZero;
                    self.selectButtonFrame = CGRectZero;
                    self.disabledSelectButtonFrame = CGRectZero;
                    
                    {
                        self.bottomLabelFrame = CGRectZero;
                        self.bottomLabelLayout = nil;
                    }
                } else if ([model.order.candidate.uid isEqualToString:CurrentUserID]) { // 大神
                    self.show = NO;
                } else { // 游客
                    self.show = NO;
                }
            }
                break;
            case 8: // 填写结果-打了
            {
                if ([model.feed.author.uid isEqualToString:CurrentUserID]) { // 发布者
                    self.show = YES;
                    {
                        NSString *top = @"我的接单大神";
                        NSMutableAttributedString *topString = [[NSMutableAttributedString alloc] initWithString:top];
                        topString.font = [UIFont systemFontOfSize:12];
                        topString.color = UIColorHex(A7ABB4);
                        YYTextContainer *textContiner = [YYTextContainer containerWithSize:CGSizeMake(MAXFLOAT, MAXFLOAT)];
                        self.topLabelLayout = [YYTextLayout layoutWithContainer:textContiner text:topString];
                        self.topLabelFrame = CGRectMake(15, 0, self.topLabelLayout.textBoundingRect.size.width, 30);
                    }
                    {
                        self.topLineViewFrame = CGRectMake(16, 30, kScreenWidth - 16, 0.5);
                    }
                    {
                        self.headerImageViewFrame = CGRectMake(15, 41, 30, 30);
                        self.headerImageViewURL = [NSURL URLWithString:model.order.candidate.thumbnail];
                    }
                    
                    {
                        self.statusLabelLayout = nil;
                        self.statusLabelFrame = CGRectZero;
                    }
                    
                    {
                        NSString *userName = model.order.candidate.username;
                        NSString *uid = model.order.candidate.uid;
                        NSInteger baojiLevel = [model.order.candidate.identity integerValue];
                        baojiLevel = 100;
                        NSMutableAttributedString *bottomString = [NSMutableAttributedString new];
                        NSMutableAttributedString *nameString = [[NSMutableAttributedString alloc] initWithString:userName];
                        nameString.color = UIColorHex(A7ABB4);
                        nameString.font = [UIFont systemFontOfSize:12];
                        YYTextHighlight *highLight = [YYTextHighlight new];
                        highLight.userInfo = @{kFeedTopClickUser:uid};
                        [nameString setTextHighlight:highLight range:nameString.string.rangeOfAll];
                        [bottomString appendAttributedString:nameString];
                        
                        if (baojiLevel == 100 || baojiLevel == 101 || baojiLevel == 102) {
                            NSAttributedString *bjString = [self attributedStringWithImageSize:CGSizeMake(31, 15) image:[JKRFeedDetailHelper imageNamed:[NSString stringWithFormat:@"bj_%zd", baojiLevel]]];
                            [bottomString appendAttributedString:bjString];
                        }
                        
                        bottomString.lineBreakMode = NSLineBreakByTruncatingMiddle;
                        YYTextContainer *container = [YYTextContainer containerWithSize:CGSizeMake(kScreenWidth - self.statusLabelFrame.size.width - 15 - 55 - 10, MAXFLOAT)];
                        self.userLabelLayout = [YYTextLayout layoutWithContainer:container text:bottomString];
                        self.userLabelFrame = CGRectMake(55, 47 - ((baojiLevel == 100 || baojiLevel == 101 || baojiLevel == 102) ? 16 : 0), self.userLabelLayout.textBoundingRect.size.width, self.userLabelLayout.textBoundingRect.size.height + 2);
                    }
                    
                    self.finishButtonFrame = CGRectZero;
                    self.chatButtonFrame = CGRectMake(kScreenWidth - 117 - 90, 94, 90, 30);
                    self.startButtonFrame = CGRectMake(kScreenWidth - 15 - 90, 94, 90, 30);
                    self.selectButtonFrame = CGRectZero;
                    self.disabledSelectButtonFrame = CGRectZero;
                    
                    {
                        self.bottomLabelFrame = CGRectZero;
                        self.bottomLabelLayout = nil;
                    }
                } else if ([model.order.candidate.uid isEqualToString:CurrentUserID]) { // 大神
                    self.show = NO;
                } else { // 游客
                    self.show = NO;
                }
            }
                break;
            case 9: // 填写结果-没打
            {
                if ([model.feed.author.uid isEqualToString:CurrentUserID]) { // 发布者
                    self.show = YES;
                    {
                        NSString *top = @"我的接单大神";
                        NSMutableAttributedString *topString = [[NSMutableAttributedString alloc] initWithString:top];
                        topString.font = [UIFont systemFontOfSize:12];
                        topString.color = UIColorHex(A7ABB4);
                        YYTextContainer *textContiner = [YYTextContainer containerWithSize:CGSizeMake(MAXFLOAT, MAXFLOAT)];
                        self.topLabelLayout = [YYTextLayout layoutWithContainer:textContiner text:topString];
                        self.topLabelFrame = CGRectMake(15, 0, self.topLabelLayout.textBoundingRect.size.width, 30);
                    }
                    {
                        self.topLineViewFrame = CGRectMake(16, 30, kScreenWidth - 16, 0.5);
                    }
                    {
                        self.headerImageViewFrame = CGRectMake(15, 41, 30, 30);
                        self.headerImageViewURL = [NSURL URLWithString:model.order.candidate.thumbnail];
                    }
                    
                    {
                        if (model.order.tracking.desc.length) {
                            NSMutableAttributedString *descString = [[NSMutableAttributedString alloc] initWithString:model.order.tracking.desc];
                            descString.font = [UIFont systemFontOfSize:12];
                            descString.color = UIColorHex(FFA718);
                            YYTextContainer *container = [YYTextContainer containerWithSize:CGSizeMake(MAXFLOAT, MAXFLOAT)];
                            self.statusLabelLayout = [YYTextLayout layoutWithContainer:container text:descString];
                            self.statusLabelFrame = CGRectMake(kScreenWidth - 15 - self.statusLabelLayout.textBoundingRect.size.width, 47, self.statusLabelLayout.textBoundingRect.size.width, self.statusLabelLayout.textBoundingRect.size.height);
                        } else {
                            self.statusLabelLayout = nil;
                            self.statusLabelFrame = CGRectZero;
                        }
                    }
                    
                    {
                        NSString *userName = model.order.candidate.username;
                        NSString *uid = model.order.candidate.uid;
                        NSInteger baojiLevel = [model.order.candidate.identity integerValue];
                        baojiLevel = 100;
                        NSMutableAttributedString *bottomString = [NSMutableAttributedString new];
                        NSMutableAttributedString *nameString = [[NSMutableAttributedString alloc] initWithString:userName];
                        nameString.color = UIColorHex(A7ABB4);
                        nameString.font = [UIFont systemFontOfSize:12];
                        YYTextHighlight *highLight = [YYTextHighlight new];
                        highLight.userInfo = @{kFeedTopClickUser:uid};
                        [nameString setTextHighlight:highLight range:nameString.string.rangeOfAll];
                        [bottomString appendAttributedString:nameString];
                        
                        if (baojiLevel == 100 || baojiLevel == 101 || baojiLevel == 102) {
                            NSAttributedString *bjString = [self attributedStringWithImageSize:CGSizeMake(31, 15) image:[JKRFeedDetailHelper imageNamed:[NSString stringWithFormat:@"bj_%zd", baojiLevel]]];
                            [bottomString appendAttributedString:bjString];
                        }
                        
                        bottomString.lineBreakMode = NSLineBreakByTruncatingMiddle;
                        YYTextContainer *container = [YYTextContainer containerWithSize:CGSizeMake(kScreenWidth - self.statusLabelFrame.size.width - 15 - 55 - 10, MAXFLOAT)];
                        self.userLabelLayout = [YYTextLayout layoutWithContainer:container text:bottomString];
                        self.userLabelFrame = CGRectMake(55, 47 - ((baojiLevel == 100 || baojiLevel == 101 || baojiLevel == 102) ? 16 : 0), self.userLabelLayout.textBoundingRect.size.width, self.userLabelLayout.textBoundingRect.size.height + 2);
                    }
                    
                    self.finishButtonFrame = CGRectZero;
                    self.chatButtonFrame = CGRectMake(kScreenWidth - 15 - 90, 94, 90, 30);
                    self.startButtonFrame = CGRectZero;
                    self.selectButtonFrame = CGRectZero;
                    self.disabledSelectButtonFrame = CGRectZero;
                    
                    {
                        self.bottomLabelFrame = CGRectZero;
                        self.bottomLabelLayout = nil;
                    }
                } else if ([model.order.candidate.uid isEqualToString:CurrentUserID]) { // 大神
                    self.show = NO;
                } else { // 游客
                    self.show = NO;
                }
            }
                break;
            case 10: // 填写打了超时未确认或者确认服务
            {
                if ([model.feed.author.uid isEqualToString:CurrentUserID]) { // 发布者
                    self.show = YES;
                    {
                        NSString *top = @"我的接单大神";
                        NSMutableAttributedString *topString = [[NSMutableAttributedString alloc] initWithString:top];
                        topString.font = [UIFont systemFontOfSize:12];
                        topString.color = UIColorHex(A7ABB4);
                        YYTextContainer *textContiner = [YYTextContainer containerWithSize:CGSizeMake(MAXFLOAT, MAXFLOAT)];
                        self.topLabelLayout = [YYTextLayout layoutWithContainer:textContiner text:topString];
                        self.topLabelFrame = CGRectMake(15, 0, self.topLabelLayout.textBoundingRect.size.width, 30);
                    }
                    {
                        self.topLineViewFrame = CGRectMake(16, 30, kScreenWidth - 16, 0.5);
                    }
                    {
                        self.headerImageViewFrame = CGRectMake(15, 41, 30, 30);
                        self.headerImageViewURL = [NSURL URLWithString:model.order.candidate.thumbnail];
                    }
                    
                    {
                        if (model.order.tracking.desc.length) {
                            NSMutableAttributedString *descString = [[NSMutableAttributedString alloc] initWithString:model.order.tracking.desc];
                            descString.font = [UIFont systemFontOfSize:12];
                            descString.color = UIColorHex(FFA718);
                            YYTextContainer *container = [YYTextContainer containerWithSize:CGSizeMake(MAXFLOAT, MAXFLOAT)];
                            self.statusLabelLayout = [YYTextLayout layoutWithContainer:container text:descString];
                            self.statusLabelFrame = CGRectMake(kScreenWidth - 15 - self.statusLabelLayout.textBoundingRect.size.width, 47, self.statusLabelLayout.textBoundingRect.size.width, self.statusLabelLayout.textBoundingRect.size.height);
                        } else {
                            self.statusLabelLayout = nil;
                            self.statusLabelFrame = CGRectZero;
                        }
                    }
                    
                    {
                        NSString *userName = model.order.candidate.username;
                        NSString *uid = model.order.candidate.uid;
                        NSInteger baojiLevel = [model.order.candidate.identity integerValue];
                        baojiLevel = 100;
                        NSMutableAttributedString *bottomString = [NSMutableAttributedString new];
                        NSMutableAttributedString *nameString = [[NSMutableAttributedString alloc] initWithString:userName];
                        nameString.color = UIColorHex(A7ABB4);
                        nameString.font = [UIFont systemFontOfSize:12];
                        YYTextHighlight *highLight = [YYTextHighlight new];
                        highLight.userInfo = @{kFeedTopClickUser:uid};
                        [nameString setTextHighlight:highLight range:nameString.string.rangeOfAll];
                        [bottomString appendAttributedString:nameString];
                        
                        if (baojiLevel == 100 || baojiLevel == 101 || baojiLevel == 102) {
                            NSAttributedString *bjString = [self attributedStringWithImageSize:CGSizeMake(31, 15) image:[JKRFeedDetailHelper imageNamed:[NSString stringWithFormat:@"bj_%zd", baojiLevel]]];
                            [bottomString appendAttributedString:bjString];
                        }
                        
                        bottomString.lineBreakMode = NSLineBreakByTruncatingMiddle;
                        YYTextContainer *container = [YYTextContainer containerWithSize:CGSizeMake(kScreenWidth - self.statusLabelFrame.size.width - 15 - 55 - 10, MAXFLOAT)];
                        self.userLabelLayout = [YYTextLayout layoutWithContainer:container text:bottomString];
                        self.userLabelFrame = CGRectMake(55, 47 - ((baojiLevel == 100 || baojiLevel == 101 || baojiLevel == 102) ? 16 : 0), self.userLabelLayout.textBoundingRect.size.width, self.userLabelLayout.textBoundingRect.size.height + 2);
                    }
                    
                    self.finishButtonFrame = CGRectZero;
                    self.chatButtonFrame = CGRectMake(kScreenWidth - 15 - 90, 94, 90, 30);
                    self.startButtonFrame = CGRectZero;
                    self.selectButtonFrame = CGRectZero;
                    self.disabledSelectButtonFrame = CGRectZero;
                    
                    {
                        self.bottomLabelFrame = CGRectZero;
                        self.bottomLabelLayout = nil;
                    }
                } else if ([model.order.candidate.uid isEqualToString:CurrentUserID]) { // 大神
                    self.show = NO;
                } else { // 游客
                    self.show = NO;
                }
            }
                break;
            case 11: // 发起投诉
            {
                if ([model.feed.author.uid isEqualToString:CurrentUserID]) { // 发布者
                    self.show = YES;
                    {
                        NSString *top = @"我的接单大神";
                        NSMutableAttributedString *topString = [[NSMutableAttributedString alloc] initWithString:top];
                        topString.font = [UIFont systemFontOfSize:12];
                        topString.color = UIColorHex(A7ABB4);
                        YYTextContainer *textContiner = [YYTextContainer containerWithSize:CGSizeMake(MAXFLOAT, MAXFLOAT)];
                        self.topLabelLayout = [YYTextLayout layoutWithContainer:textContiner text:topString];
                        self.topLabelFrame = CGRectMake(15, 0, self.topLabelLayout.textBoundingRect.size.width, 30);
                    }
                    {
                        self.topLineViewFrame = CGRectMake(16, 30, kScreenWidth - 16, 0.5);
                    }
                    {
                        self.headerImageViewFrame = CGRectMake(15, 41, 30, 30);
                        self.headerImageViewURL = [NSURL URLWithString:model.order.candidate.thumbnail];
                    }
                    
                    {
                        if (model.order.tracking.desc.length) {
                            NSMutableAttributedString *descString = [[NSMutableAttributedString alloc] initWithString:model.order.tracking.desc];
                            descString.font = [UIFont systemFontOfSize:12];
                            descString.color = UIColorHex(FFA718);
                            YYTextContainer *container = [YYTextContainer containerWithSize:CGSizeMake(MAXFLOAT, MAXFLOAT)];
                            self.statusLabelLayout = [YYTextLayout layoutWithContainer:container text:descString];
                            self.statusLabelFrame = CGRectMake(kScreenWidth - 15 - self.statusLabelLayout.textBoundingRect.size.width, 47, self.statusLabelLayout.textBoundingRect.size.width, self.statusLabelLayout.textBoundingRect.size.height);
                        } else {
                            self.statusLabelLayout = nil;
                            self.statusLabelFrame = CGRectZero;
                        }
                    }
                    
                    {
                        NSString *userName = model.order.candidate.username;
                        NSString *uid = model.order.candidate.uid;
                        NSInteger baojiLevel = [model.order.candidate.identity integerValue];
                        baojiLevel = 100;
                        NSMutableAttributedString *bottomString = [NSMutableAttributedString new];
                        NSMutableAttributedString *nameString = [[NSMutableAttributedString alloc] initWithString:userName];
                        nameString.color = UIColorHex(A7ABB4);
                        nameString.font = [UIFont systemFontOfSize:12];
                        YYTextHighlight *highLight = [YYTextHighlight new];
                        highLight.userInfo = @{kFeedTopClickUser:uid};
                        [nameString setTextHighlight:highLight range:nameString.string.rangeOfAll];
                        [bottomString appendAttributedString:nameString];
                        
                        if (baojiLevel == 100 || baojiLevel == 101 || baojiLevel == 102) {
                            NSAttributedString *bjString = [self attributedStringWithImageSize:CGSizeMake(31, 15) image:[JKRFeedDetailHelper imageNamed:[NSString stringWithFormat:@"bj_%zd", baojiLevel]]];
                            [bottomString appendAttributedString:bjString];
                        }
                        
                        bottomString.lineBreakMode = NSLineBreakByTruncatingMiddle;
                        YYTextContainer *container = [YYTextContainer containerWithSize:CGSizeMake(kScreenWidth - self.statusLabelFrame.size.width - 15 - 55 - 10, MAXFLOAT)];
                        self.userLabelLayout = [YYTextLayout layoutWithContainer:container text:bottomString];
                        self.userLabelFrame = CGRectMake(55, 47 - ((baojiLevel == 100 || baojiLevel == 101 || baojiLevel == 102) ? 16 : 0), self.userLabelLayout.textBoundingRect.size.width, self.userLabelLayout.textBoundingRect.size.height + 2);
                    }
                    
                    self.finishButtonFrame = CGRectZero;
                    self.chatButtonFrame = CGRectMake(kScreenWidth - 15 - 90, 94, 90, 30);
                    self.startButtonFrame = CGRectZero;
                    self.selectButtonFrame = CGRectZero;
                    self.disabledSelectButtonFrame = CGRectZero;
                    
                    {
                        self.bottomLabelFrame = CGRectZero;
                        self.bottomLabelLayout = nil;
                    }
                } else if ([model.order.candidate.uid isEqualToString:CurrentUserID]) { // 大神
                    self.show = NO;
                } else { // 游客
                    self.show = NO;
                }
            }
                break;
            case 12: // 申诉成功
            {
                if ([model.feed.author.uid isEqualToString:CurrentUserID]) { // 发布者
                    self.show = YES;
                    {
                        NSString *top = @"我的接单大神";
                        NSMutableAttributedString *topString = [[NSMutableAttributedString alloc] initWithString:top];
                        topString.font = [UIFont systemFontOfSize:12];
                        topString.color = UIColorHex(A7ABB4);
                        YYTextContainer *textContiner = [YYTextContainer containerWithSize:CGSizeMake(MAXFLOAT, MAXFLOAT)];
                        self.topLabelLayout = [YYTextLayout layoutWithContainer:textContiner text:topString];
                        self.topLabelFrame = CGRectMake(15, 0, self.topLabelLayout.textBoundingRect.size.width, 30);
                    }
                    {
                        self.topLineViewFrame = CGRectMake(16, 30, kScreenWidth - 16, 0.5);
                    }
                    {
                        self.headerImageViewFrame = CGRectMake(15, 41, 30, 30);
                        self.headerImageViewURL = [NSURL URLWithString:model.order.candidate.thumbnail];
                    }
                    
                    {
                        if (model.order.tracking.desc.length) {
                            NSMutableAttributedString *descString = [[NSMutableAttributedString alloc] initWithString:model.order.tracking.desc];
                            descString.font = [UIFont systemFontOfSize:12];
                            descString.color = UIColorHex(FFA718);
                            YYTextContainer *container = [YYTextContainer containerWithSize:CGSizeMake(MAXFLOAT, MAXFLOAT)];
                            self.statusLabelLayout = [YYTextLayout layoutWithContainer:container text:descString];
                            self.statusLabelFrame = CGRectMake(kScreenWidth - 15 - self.statusLabelLayout.textBoundingRect.size.width, 47, self.statusLabelLayout.textBoundingRect.size.width, self.statusLabelLayout.textBoundingRect.size.height);
                        } else {
                            self.statusLabelLayout = nil;
                            self.statusLabelFrame = CGRectZero;
                        }
                    }
                    
                    {
                        NSString *userName = model.order.candidate.username;
                        NSString *uid = model.order.candidate.uid;
                        NSInteger baojiLevel = [model.order.candidate.identity integerValue];
                        baojiLevel = 100;
                        NSMutableAttributedString *bottomString = [NSMutableAttributedString new];
                        NSMutableAttributedString *nameString = [[NSMutableAttributedString alloc] initWithString:userName];
                        nameString.color = UIColorHex(A7ABB4);
                        nameString.font = [UIFont systemFontOfSize:12];
                        YYTextHighlight *highLight = [YYTextHighlight new];
                        highLight.userInfo = @{kFeedTopClickUser:uid};
                        [nameString setTextHighlight:highLight range:nameString.string.rangeOfAll];
                        [bottomString appendAttributedString:nameString];
                        
                        if (baojiLevel == 100 || baojiLevel == 101 || baojiLevel == 102) {
                            NSAttributedString *bjString = [self attributedStringWithImageSize:CGSizeMake(31, 15) image:[JKRFeedDetailHelper imageNamed:[NSString stringWithFormat:@"bj_%zd", baojiLevel]]];
                            [bottomString appendAttributedString:bjString];
                        }
                        
                        bottomString.lineBreakMode = NSLineBreakByTruncatingMiddle;
                        YYTextContainer *container = [YYTextContainer containerWithSize:CGSizeMake(kScreenWidth - self.statusLabelFrame.size.width - 15 - 55 - 10, MAXFLOAT)];
                        self.userLabelLayout = [YYTextLayout layoutWithContainer:container text:bottomString];
                        self.userLabelFrame = CGRectMake(55, 47 - ((baojiLevel == 100 || baojiLevel == 101 || baojiLevel == 102) ? 16 : 0), self.userLabelLayout.textBoundingRect.size.width, self.userLabelLayout.textBoundingRect.size.height + 2);
                    }
                    
                    self.finishButtonFrame = CGRectZero;
                    self.chatButtonFrame = CGRectMake(kScreenWidth - 15 - 90, 94, 90, 30);
                    self.startButtonFrame = CGRectZero;
                    self.selectButtonFrame = CGRectZero;
                    self.disabledSelectButtonFrame = CGRectZero;
                    
                    {
                        self.bottomLabelFrame = CGRectZero;
                        self.bottomLabelLayout = nil;
                    }
                } else if ([model.order.candidate.uid isEqualToString:CurrentUserID]) { // 大神
                    self.show = NO;
                } else { // 游客
                    self.show = NO;
                }
            }
                break;
            case 13: // 申诉失败
            {
                if ([model.feed.author.uid isEqualToString:CurrentUserID]) { // 发布者
                    self.show = YES;
                    {
                        NSString *top = @"我的接单大神";
                        NSMutableAttributedString *topString = [[NSMutableAttributedString alloc] initWithString:top];
                        topString.font = [UIFont systemFontOfSize:12];
                        topString.color = UIColorHex(A7ABB4);
                        YYTextContainer *textContiner = [YYTextContainer containerWithSize:CGSizeMake(MAXFLOAT, MAXFLOAT)];
                        self.topLabelLayout = [YYTextLayout layoutWithContainer:textContiner text:topString];
                        self.topLabelFrame = CGRectMake(15, 0, self.topLabelLayout.textBoundingRect.size.width, 30);
                    }
                    {
                        self.topLineViewFrame = CGRectMake(16, 30, kScreenWidth - 16, 0.5);
                    }
                    {
                        self.headerImageViewFrame = CGRectMake(15, 41, 30, 30);
                        self.headerImageViewURL = [NSURL URLWithString:model.order.candidate.thumbnail];
                    }
                    
                    {
                        if (model.order.tracking.desc.length) {
                            NSMutableAttributedString *descString = [[NSMutableAttributedString alloc] initWithString:model.order.tracking.desc];
                            descString.font = [UIFont systemFontOfSize:12];
                            descString.color = UIColorHex(FFA718);
                            YYTextContainer *container = [YYTextContainer containerWithSize:CGSizeMake(MAXFLOAT, MAXFLOAT)];
                            self.statusLabelLayout = [YYTextLayout layoutWithContainer:container text:descString];
                            self.statusLabelFrame = CGRectMake(kScreenWidth - 15 - self.statusLabelLayout.textBoundingRect.size.width, 47, self.statusLabelLayout.textBoundingRect.size.width, self.statusLabelLayout.textBoundingRect.size.height);
                        } else {
                            self.statusLabelLayout = nil;
                            self.statusLabelFrame = CGRectZero;
                        }
                    }
                    
                    {
                        NSString *userName = model.order.candidate.username;
                        NSString *uid = model.order.candidate.uid;
                        NSInteger baojiLevel = [model.order.candidate.identity integerValue];
                        baojiLevel = 100;
                        NSMutableAttributedString *bottomString = [NSMutableAttributedString new];
                        NSMutableAttributedString *nameString = [[NSMutableAttributedString alloc] initWithString:userName];
                        nameString.color = UIColorHex(A7ABB4);
                        nameString.font = [UIFont systemFontOfSize:12];
                        YYTextHighlight *highLight = [YYTextHighlight new];
                        highLight.userInfo = @{kFeedTopClickUser:uid};
                        [nameString setTextHighlight:highLight range:nameString.string.rangeOfAll];
                        [bottomString appendAttributedString:nameString];
                        
                        if (baojiLevel == 100 || baojiLevel == 101 || baojiLevel == 102) {
                            NSAttributedString *bjString = [self attributedStringWithImageSize:CGSizeMake(31, 15) image:[JKRFeedDetailHelper imageNamed:[NSString stringWithFormat:@"bj_%zd", baojiLevel]]];
                            [bottomString appendAttributedString:bjString];
                        }
                        
                        bottomString.lineBreakMode = NSLineBreakByTruncatingMiddle;
                        YYTextContainer *container = [YYTextContainer containerWithSize:CGSizeMake(kScreenWidth - self.statusLabelFrame.size.width - 15 - 55 - 10, MAXFLOAT)];
                        self.userLabelLayout = [YYTextLayout layoutWithContainer:container text:bottomString];
                        self.userLabelFrame = CGRectMake(55, 47 - ((baojiLevel == 100 || baojiLevel == 101 || baojiLevel == 102) ? 16 : 0), self.userLabelLayout.textBoundingRect.size.width, self.userLabelLayout.textBoundingRect.size.height + 2);
                    }
                    
                    self.finishButtonFrame = CGRectZero;
                    self.chatButtonFrame = CGRectMake(kScreenWidth - 15 - 90, 94, 90, 30);
                    self.startButtonFrame = CGRectZero;
                    self.selectButtonFrame = CGRectZero;
                    self.disabledSelectButtonFrame = CGRectZero;
                    
                    {
                        self.bottomLabelFrame = CGRectZero;
                        self.bottomLabelLayout = nil;
                    }
                } else if ([model.order.candidate.uid isEqualToString:CurrentUserID]) { // 大神
                    self.show = NO;
                } else { // 游客
                    self.show = NO;
                }
            }
                break;
            default:
                break;
        }
        
    }
    
    return self;
}

- (NSAttributedString *)attributedStringWithImageSize:(CGSize)size image:(UIImage *)image {
    CGFloat ascent = size.width * 0.86;
    CGFloat descent = size.height * 0.14;
    CGRect bounding = CGRectMake(0, -0.14 * size.width + 2, size.width * 0.9, size.height * 0.9);
    UIEdgeInsets contentInsets = UIEdgeInsetsMake(ascent - (bounding.size.height + bounding.origin.y), 0, descent + bounding.origin.y, 0);
    
    YYTextRunDelegate *delegate = [YYTextRunDelegate new];
    delegate.ascent = ascent;
    delegate.descent = descent;
    delegate.width = bounding.size.width;
    
    YYTextAttachment *attachment = [YYTextAttachment new];
    attachment.contentMode = UIViewContentModeScaleAspectFit;
    attachment.contentInsets = contentInsets;
    attachment.content = image;
    
    NSMutableAttributedString *atr = [[NSMutableAttributedString alloc] initWithString:YYTextAttachmentToken];
    [atr setTextAttachment:attachment range:NSMakeRange(0, atr.length)];
    CTRunDelegateRef ctDelegate = delegate.CTRunDelegate;
    [atr setRunDelegate:ctDelegate range:NSMakeRange(0, atr.length)];
    if (ctDelegate) CFRelease(ctDelegate);
    
    return atr;
}

@end
